#!/usr/bin/python
# vim:ts=4:sw=4:softtabstop=0:smarttab
# License: LGPL
# Keith Dart <kdart@kdart.com>


DATABASE_URL = 'postgres://pycopia@localhost/pycopia'

### web interface

# User to run handler as. Main server must be run as root for this to have
# any effect.
USERNAME = "tester"

ADMINS = [
    'Keith Dart <keith@dartworks.biz>',
]

#MIDDLEWARE = [("firepython.middleware.FirePythonWSGI",)]
MIDDLEWARE = []

# Map pattern to handler functions. 
LOCATIONMAP = (
#  (r"^/api/(?P<methodname>\w+)$", "pycopia.db.webservice.dispatcher"),
  (r"^/?$", "pycopia.QA.webui.testcases.main"),
  # test cases
  (r"^/dashboard/$", "pycopia.QA.webui.dashboard.main"),
  (r"^/dashframe/$", "pycopia.QA.webui.dashboard.dashframe"),
# basic testcase editor
  (r"^/testcase/$", "pycopia.QA.webui.testcases.testcase_list"),
  (r"^/testcase/view/(?P<tcid>\S+)/?$", "pycopia.QA.webui.testcases.testcase_view"),
  (r"^/testcase/view/?$", "pycopia.WWW.framework.redirectup"),
  (r"^/testcase/edit/(?P<tcid>\S+)/?$", "pycopia.QA.webui.testcases.testcase_edit"),
  (r"^/testcase/edit/?$", "pycopia.WWW.framework.redirectup"),
  (r"^/testcase/run/(?P<tcid>\S+)/?$", "pycopia.QA.webui.testcases.testcase_run"),
  (r"^/testcase/run/?$", "pycopia.WWW.framework.redirectup"),
  (r"^/testcase/new/?$", "pycopia.QA.webui.testcases.testcase_create"),
  # test results
  (r"^/testresults/?$", "pycopia.QA.webui.testresults.testresults_list"),
    # media locations. aliases don't have a dot in the name.
  (r'/media/css/(?P<name>\S+)', "css"),
  (r'/media/js/(?P<name>\S+)', "js"),
  (r'/media/images/(?P<name>\S+)', "images"),
  (r'/auth/login', "login"),
  (r'/auth/logout', "logout"),
)

# These should all be 24x24 icons
ICONMAP = {
# simplename     active         inactive (base state)
#"xxx": ("icon_xxx_active.png", "icon_xxx_inactive.png"),
  "default": (None, "icon_default_inactive.png"),
  "add": ("icon_add_active.png", "icon_add_inactive.png"),
  "go": (None, "gobutton_large.png"),
  "edit": ("icon_edit_active.png", "icon_edit_inactive.png"),
  "delete": ("icon_delete_active.png", "icon_delete_inactive.png"),
  "activate": ("icon_activate_active.png", "icon_activate_inactive.png"),
  "isactive": ("icon_isactive_active.png", "icon_isactive_inactive.png"),
  "isinactive": ("icon_isinactive_active.png", "icon_isinactive_inactive.png"),
  "unknown": ("icon_unknown_active.png", "icon_unknown_inactive.png"),
  "plus": ("icon_plus_active.png", "icon_plus_inactive.png"),
  "minus": ("icon_minus_active.png", "icon_minus_inactive.png"),
  "alert": (None, "icon_alert_inactive.png"),
}

# these should all be 16x16 icons
ICONMAP_MEDIUM = {
# simplename     active         inactive (base state)
#"xxx": "icon_xxx.png",
  "default": "icon_alert.png",
  "search": "icon_searchbox.png",
  "success": "icon_success.png",
  "failure": "icon_error.png",
  "incomplete": "icon_alert.png",
  "calendar": "icon_calendar.png",
  "clock": "icon_clock.png",
}

# these should all be 10x10 icons
ICONMAP_SMALL = {
# simplename     active         inactive (base state)
#"xxx": "icon_xxx.png",
  "default": "icon-unknown.png",
  "edit": "icon_changelink.png",
  "delete": "icon_deletelink.png",
  "add": "icon_addlink.png",
  "go": "gobutton_small.png",
  "unknown": "icon-unknown.png",
  "yes": "icon-yes.png",
  "no": "icon-no.png",
}

